/*
 * @Author       : NaN 353362604@qq.com
 * @Date         : 2023-08-10 14:49:50
 * @LastEditTime : 2023-08-24 09:03:24
 * @LastEditors  : NaN 353362604@qq.com
 * @FilePath     : \AdminStration\src\Pages\Front\Assets\Template\TemplateMap\TemplateMapDivList.jsx
 * @Description  :
 */
import './TemplateMapDivList.scss'
import { ProvinceList, Map230000 } from '../../../../../Common/Configure/CommonParameter'
import { project } from '../../../../../Common/Data'

const { imageUrl } = project[window.location.hostname]

const TemplateMapDiv001 = ({ item, ActiveList, active }) => {
    return {
        id: item + '-label',
        attr: 'TemplateMapDiv',
        position: ProvinceList[item].position,
        show: active,
        style: {
            html: ` <div class="TemplateMapDiv001"> 本省项目共计 : ${ActiveList[item]}+ </div>`,
            offsetX: -80,
            offsetY: -25,
        },
    }
}

const TemplateMapDiv002 = ({ item }) => {
    return {
        id: item.uuid + '-label',
        attr: 'TemplateMapDiv',
        position: item.position,
        show: false,
        style: {
            html: ` 
                <div class="TemplateMapDiv002">
                    <div> ${item.label} </div>
                </div>
            `,
            offsetX: -250,
            offsetY: -34,
        },
    }
}

const TemplateMapDiv003 = ({ item }) => {
    return {
        id: item.uuid + '-label',
        attr: 'TemplateMapDiv',
        position: item.position,
        show: true,
        style: {
            html: ` 
                <div class="TemplateMapDiv002">
                    <div> ${item.label} </div>
                </div>
            `,
            offsetX: -250,
            offsetY: -34,
        },
    }
}
const TemplateMapDiv004 = ({ key, number }) => {
    return {
        id: key,
        attr: 'TemplateMapDiv',
        position: ProvinceList[key].position,
        style: {
            html: ` <div class="TemplateMapDiv001"> 数量 : ${number} </div>`,
            offsetX: -80,
            offsetY: -25,
        },
    }
}

const TemplateMapDiv005 = ({ data }) => {
    const superviseType = {
        '9c256a7d-ae64-4fcc-a4bc-7edff75599f3': imageUrl + 'Waring001.png',
        'a17b2c16-668e-4449-b793-1487ba698e77': imageUrl + 'Waring002.png',
        'b75a2f2f-e107-459a-a331-35bd9924a2b7': imageUrl + 'Waring003.png',
        '4d3fd238-6473-429a-a1ab-8f35c6af97ab': imageUrl + 'Waring004.png',
    }
    const { tableName, remark, superviseTypeUuid } = data
    return {
        position: JSON.parse(remark),
        style: {
            html: ` 
                <div class="TemplateMapDiv005">
                    <div>
                        <div>${tableName}</div>
                    </div>
                    <img class='PileFoundation001' src='${superviseType[superviseTypeUuid]}'/>
                </div>
            `,
        },
    }
}

const TemplateMapDiv006 = ({ item }) => {
    return {
        id: item.code,
        attr: 'TemplateMapDiv',
        position: Map230000[item.code || 230100].position,
        style: {
            html: `
                <div  class="TemplateMapDiv001"> 
                    项目数量 : ${item.projectCount} 
                </div>
            `,
            offsetX: -80,
            offsetY: -25,
        },
    }
}

export const TemplateMapDivList = {
    TemplateMapDiv001,
    TemplateMapDiv002,
    TemplateMapDiv003,
    TemplateMapDiv004,
    TemplateMapDiv005,
    TemplateMapDiv006,
}
